import 'package:flutter/material.dart';
import 'package:module/home_page.dart';
import 'package:module/me_page.dart';
import 'package:module/const.dart';

class ZhujiPage extends StatefulWidget {
  const ZhujiPage({super.key});

  @override
  State<ZhujiPage> createState() => _ZhujiPageState();
}

class _ZhujiPageState extends State<ZhujiPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0,
        backgroundColor: Colors.white,
        centerTitle: true,
        title: Text(
          '我的足迹',
          style: TextStyle(color: Colors.black),
        ),
        leading: GestureDetector(
          onTap: () {
            // Navigator.of(context).pop();
            Navigator.push(context, MaterialPageRoute(builder: (context) {
              return HomePage();
            }));
          },
          child: Transform.scale(
            scale: 0.5,
            child: Image.asset(
              'assets/icon_back.png',
            ),
          ),
        ),
      ),
      body: Container(
        color: Constants.bgColor,
        child: ListView.builder(
          itemBuilder: (BuildContext context, int index) {
            // final item = nav[index];
            return Container(
              child: Column(
                children: [
                  Container(
                    padding: EdgeInsets.symmetric(vertical: 15, horizontal: 20),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      nav[index]['createTime'],
                      style: const TextStyle(fontSize: 18),
                    ),
                  ),
                  Container(
                    height: 100,
                    color: Colors.white,
                    child: Column(
                      children: [Text(nav[index]['createTime'])],
                    ),
                  )
                ],
              ),
            );
          },
          itemCount: nav.length,
        ),
      ),
    );
  }
}
